package controller.taskManagement;

import java.util.ArrayList;

import controller.environment.ground.Ground;

public class TaskManagement {
	private static TaskManagement m_taskManagement;
	private ArrayList<Task> m_tasks;
	
	private TaskManagement(){
		m_tasks = new ArrayList<Task>();
	}
	
	public static TaskManagement getTaskManagement(){
		if(m_taskManagement==null)
			m_taskManagement = new TaskManagement();
		return m_taskManagement;
	}
	
	public ArrayList<Task> getTasks(){
		return m_tasks;
	}
	
	public void addTask(Task task){
		m_tasks.add(task);
	}
	
	public void addTask(Ground ground){
		m_tasks.add(new Task(ground));
	}
	
	public void remove(Task task){
		while(m_tasks.remove(task));
	}
}
